<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>前端系统</title>
  <link rel="stylesheet" href="../layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo"><label class="layui-font-20 layui-font-green">校园二手交易平台</label></div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">首页</a></li>
      <!--<li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>-->
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
          贤心
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="">退了</a></li>
    </ul>
  </div>
 
  <div class="layui-side layui-bg-white">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed">
          <a class="" href="javascript:;">浏览商品</a>
          <dl class="layui-nav-child">
          	<dd class="main_left"><a href="javascript:;" data-src="/tostudentlist" target="_top">鞋</a></dd>
            <dd class="main_left"><a href="javascript:;" data-src="/tostudentlist" target="_top">书籍</a></dd>
            <dd class="main_left"><a href="javascript:;" target="_top">衣物</a></dd>
            <dd class="main_left"><a href="javascript:;" target="_top">手表首饰</a></dd>
            <dd class="main_left"><a href="javascript:;" target="_top">电器</a></dd>
            <dd class="main_left"><a href="" target="_top">其他</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">个人商品发布</a>
          <dl class="layui-nav-child">
            <dd class="main_left"><a href="javascript:;" target="_top">个人商品列表</a></dd>
            <dd class="main_left"><a href="javascript:;" target="_top">发布个人商品</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;">订单管理</a>
          <dl class="layui-nav-child">
            <dd class="main_left"><a href="javascript:;" target="_top">列表一</a></dd>
          </dl>
        </li>
      </ul>
    </div>
  </div>
 
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
    	<iframe frameborder="0" scrolling="yes" style="width: 100%" src="" id="aa">
    </iframe>
    </div>
  </div>
  <div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
  </div>
</div>
<script type="text/javascript" src="../jquery/jquery-3.1.1.js" ></script>
<script src="../layui/layui.js"></script>
<script>
	 $(function(){	
 		//获取src值
        $(".main_left a").on("click",function(){
            var address =$(this).attr("data-src");
            console.log(address);
            $("iframe").attr("src",address);
        });
		//一下代码是根据窗口高度在设置iframe的高度
        var frame = $("#aa");
	
        var frameheight = $(window).height();
        console.log(frameheight);
        frame.css("height",frameheight);


    });
	
	//JavaScript代码区域
	layui.use('element', function(){
	  var element = layui.element;
	 
	});
</script>
</body>
</html>
      